extends SceneBase

var isDoor2HomeCovered = false

func _ready():
	generateCoin()
	generateEnemy()


func _process(delta):
	if Input.is_action_just_pressed("Interect") and isDoor2HomeCovered:
		Global.movePlayerToScene("homeScene", "Enter_01")
		

func _on_door_2_home_body_entered(body):
	if body.is_in_group("Player"):
		isDoor2HomeCovered = true


func _on_door_2_home_body_exited(body):
	if body.is_in_group("Player"):
		isDoor2HomeCovered = false


func _on_exit_2_street_01_body_entered(body):
	if body.is_in_group("Player"):
		Global.movePlayerToScene("street01Scene", "Enter_01")


